package villa.tools.mq.views;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.*;


class TabControlsH extends Composite{
	
	
	private Label replyToQMLabel=null;
	private Label msgIdLabel=null;
	private Label correlIdLabel=null;
	private Label expiryLabel=null;
	
	Text replyQM = null;
	Text msgId = null;
	Button msgIdCheck;
	Text correlId = null;
	Button correlIdCheck;
	Text expiry = null;
	Boolean sendItem;
	
	TabItem tabItem = null;
	
	public void setTabItem(TabItem ti){
		this.tabItem = ti;
	}
	
	/**
	 * @param parent
	 * @param style
	 */
	
	public TabControlsH(Composite parent, int style) {
		super(parent, style);
		
		try {
			
			
			FormLayout layout = new FormLayout();
			layout.marginWidth = 5;
			layout.marginHeight = 5;
			this.setLayout(layout);
			
			
			
			FormData formData = null;

			/* expiry */
			
			expiryLabel = new Label(this, SWT.NONE);
			expiryLabel.setText("Expiry (600=60seg)");
			formData = new FormData();
			formData.top = new FormAttachment(0, 0);
			formData.left = new FormAttachment(0, 0);
			formData.width = 100;
			expiryLabel.setLayoutData(formData);

			expiry = new Text(this, SWT.BORDER);
			expiry.setEditable(true);
			formData = new FormData();
			formData.top = new FormAttachment(0, 0);
			formData.left = new FormAttachment(expiryLabel, 5);
			formData.width = 350;
			expiry.setLayoutData(formData);
			expiry.setText("600");
			
			/* reply to queue manager */
			
			replyToQMLabel = new Label(this, SWT.NONE);
			replyToQMLabel.setText("Reply To QM");
			formData = new FormData();
			formData.top = new FormAttachment(expiryLabel, 10);
			formData.left = new FormAttachment(0, 0);
			formData.width = 100;
			replyToQMLabel.setLayoutData(formData);

			replyQM = new Text(this, SWT.BORDER);
			replyQM.setEditable(true);
			formData = new FormData();
			formData.top = new FormAttachment(expiryLabel, 10);
			formData.left = new FormAttachment(replyToQMLabel, 5);
			formData.width = 350;
			replyQM.setLayoutData(formData);
			replyQM.setText("TEST.RESP");

			/* msg id */
			
			msgIdLabel = new Label(this, SWT.NONE);
			msgIdLabel.setText("Msg Id");
			formData = new FormData();
			formData.top = new FormAttachment(replyToQMLabel,10);
			formData.left = new FormAttachment(0, 0);
			formData.width = 100;
			msgIdLabel.setLayoutData(formData);

			msgId = new Text(this, SWT.BORDER);
			msgId.setEditable(true);
			formData = new FormData();
			formData.top = new FormAttachment(replyToQMLabel, 10);
			formData.left = new FormAttachment(msgIdLabel, 5);
			formData.width = 350;
			msgId.setLayoutData(formData);
			
			
			
			msgIdCheck = new Button(this, SWT.CHECK);
			formData = new FormData();
			formData.top = new FormAttachment(replyToQMLabel, 12);
			formData.left = new FormAttachment(msgId, 5);
			formData.width = 35;
			msgIdCheck.setLayoutData(formData);
			
			
			
			/* correl Id */
			
			correlIdLabel = new Label(this, SWT.NONE);
			correlIdLabel.setText("Correl Id");
			formData = new FormData();
			formData.top = new FormAttachment(msgIdLabel, 10);
			formData.left = new FormAttachment(0, 0);
			formData.width = 100;
			correlIdLabel.setLayoutData(formData);

			correlId = new Text(this, SWT.BORDER);
			correlId.setEditable(true);
			formData = new FormData();
			formData.top = new FormAttachment(msgIdLabel, 10);
			formData.left = new FormAttachment(msgIdLabel, 5);
			formData.width = 350;
			correlId.setLayoutData(formData);
			
			correlIdCheck = new Button(this, SWT.CHECK);
			formData = new FormData();
			formData.top = new FormAttachment(msgIdLabel, 12);
			formData.left = new FormAttachment(correlId, 5);
			formData.width = 35;
			correlIdCheck.setLayoutData(formData);
			
			
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
}

